package com.example.hhhh;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;

/**
 * @ProjectName: Hhhh
 * @Package: com.example.hhhh
 * @ClassName: FristAct
 * @Description: java类作用描述
 * @Author: songhua
 * @CreateDate: 2019/12/20 0020 16:02
 */
@Route(path = "/app/ThreeAct")
public class ThreeAct extends SwipeBackActivity {


    @Autowired()
    int age;

    private TextView tv, tv1, tv2;

    /**
     * //获取数据三种方式
     * //1.通过Autowired注解表明key   &  需要在onCreate中调用ARouter.getInstance().inject(this);配合使用
     *
     * @Autowired(name = "key1")
     * public long data;
     * //2.通过Autowired注解 & 将key1作为属性的名称   &  需要在onCreate中调用ARouter.getInstance().inject(this);配合使用
     * @Autowired() public long key1;
     * //3.通过Bundle获取
     * getIntent().getExtras().getLong("key1")
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_three);
        ARouter.getInstance().inject(this);
        tv = (TextView) findViewById(R.id.tv);
        tv1 = (TextView) findViewById(R.id.tv1);
        tv2 = (TextView) findViewById(R.id.tv2);

        tv.setText("得到参数：" + age);

        tv1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        //底部
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                new CommonDialog1(ThreeAct.this).show();


//                CommonPopWindow.newBuilder()
//                        .setView(R.layout.recharge_prompt)
//                        .setViewOnClickListener(new CommonPopWindow.ViewClickListener() {
//                            @Override
//                            public void getChildView(PopupWindow mPopupWindow, View view, int mLayoutResId) {
////                                switch (mLayoutResId) {
////                                    case R.layout.popdemo:
////                                        TextView tv1 = (TextView) view.findViewById(R.id.pop1);
////                                        TextView tv2 = (TextView) view.findViewById(R.id.pop2);
////                                        TextView tv3 = (TextView) view.findViewById(R.id.pop3);
////                                        tv1.setOnClickListener(new View.OnClickListener() {
////                                            @Override
////                                            public void onClick(View v) {
////                                                Toast.makeText(ThreeAct.this, "tv1", Toast.LENGTH_SHORT).show();
////                                            }
////                                        });
////                                        tv2.setOnClickListener(new View.OnClickListener() {
////                                            @Override
////                                            public void onClick(View v) {
////                                                Toast.makeText(ThreeAct.this, "tv2", Toast.LENGTH_SHORT).show();
////                                            }
////                                        });
////                                        tv3.setOnClickListener(new View.OnClickListener() {
////                                            @Override
////                                            public void onClick(View v) {
////                                                Toast.makeText(ThreeAct.this, "tv3", Toast.LENGTH_SHORT).show();
////                                            }
////                                        });
////
////
////                                }
//
//                            }
//                        })
//                        .build(ThreeAct.this)
//                        .showAsBottom(tv);


            }
        });

    }
}
